import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { AuthGuard } from './auth/auth.guard'

const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule),
  },
  {
    path: 'login',
    loadChildren: () => import('./login/login/login.module').then( m => m.LoginPageModule)
  },
  {
    path: 'register',
    loadChildren: () => import('./login/register/register.module').then( m => m.RegisterPageModule)
    
  },
  {
    path: 'protocol',
    loadChildren: () => import('./login/protocol/protocol.module').then( m => m.ProtocolPageModule)
  },
  {
    path: 'list/news',
    loadChildren: () => import('./list/news/news.module').then( m => m.NewsPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'list/notice',
    loadChildren: () => import('./list/notice/notice.module').then( m => m.NoticePageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'list/ndetail',
    loadChildren: () => import('./list/noticedetail/noticedetail.module').then( m => m.NoticedetailPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'confirmorder',
    loadChildren: () => import('./confirmorder/confirmorder.module').then( m => m.ConfirmorderPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/info',
    loadChildren: () => import('./mine/info/info.module').then( m => m.InfoPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/idcenter',
    loadChildren: () => import('./mine/idcenter/idcenter.module').then( m => m.IdcenterPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/checkid',
    loadChildren: () => import('./mine/checkid/checkid.module').then( m => m.CheckidPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/invites',
    loadChildren: () => import('./mine/invites/invites.module').then( m => m.InvitesPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/mymill',
    loadChildren: () => import('./mine/mymill/mymill.module').then( m => m.MymillPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/havestore',
    loadChildren: () => import('./mine/havestore/havestore.module').then( m => m.HavestorePageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/setpwd',
    loadChildren: () => import('./mine/setpwd/setpwd.module').then( m => m.SetpwdPageModule),
    canActivate:[AuthGuard]
  },
  {
    path: 'mine/about',
    loadChildren: () => import('./mine/about/about.module').then( m => m.AboutPageModule)
  },
  {
    path: 'mine/wallet',
    loadChildren: () => import('./mine/wallet/wallet.module').then( m => m.WalletPageModule)
  },
  {
    path: 'mine/bindwallet',
    loadChildren: () => import('./mine/bindwallet/bindwallet.module').then( m => m.BindwalletPageModule)
  },
  {
    path: 'recharge',
    loadChildren: () => import('./pool/recharge/recharge.module').then( m => m.RechargePageModule)
  },
  {
    path: 'rechargerecord',
    loadChildren: () => import('./pool/rechargerecord/rechargerecord.module').then( m => m.RechargerecordPageModule)
  },
  {
    path: 'withdraw',
    loadChildren: () => import('./pool/withdraw/withdraw.module').then( m => m.WithdrawPageModule)
  },
  {
    path: 'withdrawrecord',
    loadChildren: () => import('./pool/withdrawrecord/withdrawrecord.module').then( m => m.WithdrawrecordPageModule)
  },
  {
    path: 'transfer',
    loadChildren: () => import('./pool/transfer/transfer.module').then( m => m.TransferPageModule)
  },
  {
    path: 'record',
    loadChildren: () => import('./pool/record/record.module').then( m => m.RecordPageModule)
  },
  {
    path: 'success',
    loadChildren: () => import('./pool/success/success.module').then( m => m.SuccessPageModule)
  },
  {
    path: 'mine/orderdetail',
    loadChildren: () => import('./mine/orderdetail/orderdetail.module').then( m => m.OrderdetailPageModule)
  },
  {
    path: 'activate',
    loadChildren: () => import('./mine/activate/activate.module').then( m => m.ActivatePageModule)
  },
  {
    path: 'yes',
    loadChildren: () => import('./mine/yes/yes.module').then( m => m.YesPageModule)
  },
  {
    path: 'transferrecord',
    loadChildren: () => import('./pool/transferrecord/transferrecord.module').then( m => m.TransferrecordPageModule)
  },
  {
    path: 'qbtb',
    loadChildren: () => import('./pool/qbtb/qbtb.module').then( m => m.QbtbPageModule)
  },
  {
    path: 'qbrecord',
    loadChildren: () => import('./pool/qbrecord/qbrecord.module').then( m => m.QbrecordPageModule)
  },
  {
    path: 'newsdetail',
    loadChildren: () => import('./list/newsdetail/newsdetail.module').then( m => m.NewsdetailPageModule)
  },
  {
    path: 'nodelist',
    loadChildren: () => import('./list/nodelist/nodelist.module').then( m => m.NodelistPageModule)
  },
  {
    path: 'xchtb',
    loadChildren: () => import('./pool/xchtb/xchtb.module').then( m => m.XchtbPageModule)
  },
  {
    path: 'xchtbrecord',
    loadChildren: () => import('./pool/xchtbrecord/xchtbrecord.module').then( m => m.XchtbrecordPageModule)
  }
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}
